//
//  LTView.m
//  联付商圈
//
//  Created by apple on 2017/10/31.
//  Copyright © 2017年 lianfu. All rights reserved.
//

#import "LTView.h"

@implementation LTView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.font = [UIFont systemFontOfSize:14 * FONTSIZE];
        [self addSubview:_titleLabel];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.mas_left).mas_offset(10 * FONTSIZE);
            make.top.equalTo(self.mas_top).mas_offset(0);
            make.bottom.equalTo(self.mas_bottom).mas_offset(0);
            make.width.mas_equalTo(60 * FONTSIZE);
        }];
        
        self.textField = [[UITextField alloc] init];
        [self.textField setFont:[UIFont systemFontOfSize:14 * FONTSIZE]];
//        self.textField.backgroundColor = [UIColor redColor];
        [self addSubview:_textField];
        [self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.titleLabel.mas_right).mas_offset(32 * FONTSIZE);
            make.top.equalTo(self.mas_top).mas_equalTo(0);
            make.bottom.equalTo(self.mas_bottom).mas_equalTo(0);
            make.width.mas_equalTo(frame.size.width - 102 * FONTSIZE);
        }];
        
        self.lineView = [[UIView alloc] initWithFrame:CGRectMake(0, frame.size.height - 1, frame.size.width - 10, 1)];
        self.lineView.backgroundColor = [UIColor lightGrayColor];
        self.lineView.alpha = 0.6;
        [self addSubview:_lineView];
    }
    return self;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
